<?php
require('lib/verify.php');
require('lib/has_char.php');
require('lib/is_approved.php');

$boss_id = $_GET["id"];
$sql = "select * from wm_bosses where boss_id='$boss_id'";
$result = $db->query($sql);
$boss = $db->fetch_assoc($result);

$sql = "select * from wm_instances where instance_id='" . $boss["boss_instance"] . "'";
$result = $db->query($sql);
$instance = $db->fetch_assoc($result);

$_category = "warmath";
$_title = $instance["instance_name"] . " / " . $boss["boss_name"];
require('lib/head.php');


if($_GET["error"]!="") {
  boxRed("Error");
?>
    <?=$_GET["error"]?>
<?php
    boxBot();
    }



boxTop("Warmath: <a href=\"loot-instance.php?id=" . $instance["instance_id"] . "\">" . $instance["instance_name"] ."</a> / " . $boss["boss_name"]);
?>
<?php
//@@todo: wishlist correspondance so we should folks what they have
$sql = "select * from wm_items left join item_cache on wm_items.item_id = item_cache.item_id where item_boss = '$boss_id' order by item_name asc";
$result = $db->query($sql);
$numr = $db->num_rows($result);
?>
<a href="boss.php?id=<?=$boss_id?>"><b><?=$boss["boss_name"]?></b></a> <i><?=$numr?> items</i><br />
Browse loot to mark items as max or mod.<br /><br />
<i>Mark items as max or mod; or unmark an item by selecting non.</i><br />
<?php
while($item = $db->fetch_assoc($result)) {
  show_item($item, $character, $db, "loot-boss.php?id=" . $boss_id, $system);
}
?>

<?php
boxBot();
?>

<?php
require('lib/foot.php');
?>

